<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});
Route::post('/login', ['App\Http\Controllers\UserController', 'login']);
Route::post('/checkLogin', ['App\Http\Controllers\UserController', 'checkLogin']);

Route::middleware([\App\Http\Middleware\AuthMiddleware::class])->group(function (){
    Route::get('/getUserInfo', ['App\Http\Controllers\UserController', 'getUserInfo']);
    Route::post('/saveUserInfo', ['App\Http\Controllers\UserController', 'saveUserInfo']);


    Route::get('/courseList', ['App\Http\Controllers\CourseController', 'courseList']);
    Route::post('/signUp', ['App\Http\Controllers\SignUpController', 'signUp']);
    Route::get('/signUpList', ['App\Http\Controllers\SignUpController', 'signUpList']);
    Route::post('/signUpChangeStatus', ['App\Http\Controllers\SignUpController', 'signUpChangeStatus']);
    Route::post('/saveOrUpdateEvaluate', ['App\Http\Controllers\SignUpController', 'saveOrUpdateEvaluate']);

    Route::get('/collectCourse', ['App\Http\Controllers\CourseController', 'collectCourse']);
    Route::get('/unCollectCourse', ['App\Http\Controllers\CourseController', 'unCollectCourse']);

});
